/**
 * @product: PCDC-CMS
 * @copyright: FSAI-南征北战信息科技
 * @filename: com.fsai.cms.controller.cms.PubController.java
 *
 * @link: Http://www.fastsai.com
 * @jdkv: Jdk 1.8
 */
package com.fsai.cms.controller.cms;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fsai.cms.base.BaseResp;
import com.fsai.cms.base.WebCons;
import com.fsai.cms.domain.CmsEduVideo;
import com.fsai.cms.service.ICmsPubService;
import com.github.pagehelper.PageInfo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 *
 * @project: pcdc-cms-web
 *
 * @author: JaffeHe
 * @email: JaffeHe@foxmail.com
 * @date: 2021-03-14 14:10
 *
 * @ChangeLog<br/>
 * 				Developer Date Comment <br/>
 */
@RestController
@RequestMapping("/pub")
@Api(tags = "网站管理")
public class PubController {

	@Autowired
	private ICmsPubService cmsPubService;

	@GetMapping("/video/pgdata/{cateId}/{pageSize}/{pageNum}")
	@ApiOperation("获取栏目首页文章")
	@ApiImplicitParams({ @ApiImplicitParam(name = "cateId", value = "栏目ID", required = true),
			@ApiImplicitParam(name = "pageSize", value = "每页数量", defaultValue = "10", required = true),
			@ApiImplicitParam(name = "pageNum", value = "页码", defaultValue = "1", required = true), })
	public BaseResp videoPage(@PathVariable("cateId") String cateId, @PathVariable(name = "pageSize") int pageSize,
			@PathVariable("pageNum") int pageNum) {

		CmsEduVideo query = new CmsEduVideo();
		query.setStatus(WebCons.STATUS_Y);

		PageInfo<CmsEduVideo> pageData = this.cmsPubService.queryVideoPageData(query, pageSize, pageNum);
		return BaseResp.success(pageData);
	}

}
